<!doctype html>
<html>

<head>
    <title>微品致远传送门</title>
    <meta content="微品致远传送门" name="description">
    <meta content="微品致远传送门" name="keywords">
    <!-- inject:meta -->
    <meta content="IE=edge" http-equiv="X-UA-Compatible">
    <meta charset="utf-8">
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <!-- Set render engine for 360 browser -->
    <meta content="webkit" name="renderer">
    <!-- No Baidu Siteapp-->
    <meta content="no-siteapp" http-equiv="Cache-Control"/>
    <link href="http://at.alicdn.com/t/font_p27hnfue2k18xgvi.css" rel="stylesheet" type="text/css">
    <link href="https://cdn.staticfile.org/twitter-bootstrap/5.1.1/css/bootstrap.min.css" rel="stylesheet"
          type="text/css">
    <link href="/mgn/static/css/main.css" rel="stylesheet" type="text/css"/>
    <!--js-->
    <script src="https://cdn.staticfile.org/jquery/3.2.1/jquery.min.js"></script>
    <script src="https://cdn.staticfile.org/popper.js/1.15.0/umd/popper.min.js"></script>
    <script src="https://cdn.staticfile.org/twitter-bootstrap/5.1.1/js/bootstrap.bundle.min.js"></script>
</head>
<body>
<!--头部-->
<div class="header" style="height:110px;background:#ffffff">
    <div class="header-box clearfix" style="margin-left:30px">
        <a href="#"><img alt="" class="logo" src="/mgn/static/images/637727698783507431.png"></a>
        <div class="header-nav" style="margin-top:40px">
            <nav class="navbar navbar-expand-sm justify-content-center">
                <ul class="navbar-nav">
                    <li class="nav-item" data-name="index"><a href="http://transdoor.vpclub.cn/api/">返回</a></li>
                    <li class="nav-item" data-name="config"><a
                            href="http://transdoor.vpclub.cn/api/schedu/">微品定时任务查询</a></li>
                    <li class="nav-item" data-name="config"><a href="https://cron.qqe2.com/"
                                                               target="_blank">Cron表达式</a></li>
                    <li class="nav-item" data-name="logout"><a href="#">退出</a></li>
                </ul>
            </nav>
        </div>
    </div>
</div>
<script type="text/javascript">
	$(function () {
		var name = '/' + location.pathname.split('/')[1];
		$('.header-nav').find('li[data-name="' + name + '"]').addClass('active');
	});



</script>
<!-- endinject -->

<!-- bodyer -->
<div class="bodyer">
    <div class="main-introduce main-module" style="width:95%">
        <div class="widget widget-tabs" style="margin-top:70px;">
            <h3>定时任务列表</h3><br/>
            <div class="container-fluid">
                <div class="row" id="errDiv" style="display:none">
                    <input id="errMsg" name="errMsg" type="hidden" value="{{errMsg}}">
                    <div class="col-sm-12">
                        <div class="alert alert-danger alert-dismissible fade show">
                            <button class="close" data-bs-dismiss="alert" type="button">&times;</button>
                            <strong>错误!</strong> 你应该认真阅读 <br/><a class="alert-link" href="#">{{errMsg}}</a>。
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-sm-3"></div>
                    <div class="col-sm-6">
                        <form action="/api/schedu/fetch" id="scheduSearchForm" method="GET">
                            <div class="input-group mb-4">
                                <div class="input-group-prepend">
                                    <span class="input-group-text">任务ID</span>
                                </div>
                                <input class="form-control" id="input_jobName" name="jobName" style="width:70px"
                                       type="text"/>
                                <button class="btn btn-primary" id="btnScheduFetch" type="submit">查询</button>
                                <!-- 按钮：用于打开模态框 -->
                                <button class="btn btn-danger" data-bs-target="#myModal" data-bs-toggle="modal"
                                        onclick="add()" style="margin-left: 10px" type="button">
                                    创建调度
                                </button>
                            </div>
                        </form>
                    </div>
                    <div class="col-sm-3"></div>
                </div>
                <div class="row">
                    <div class="col-sm-12" style="height:550px;overflow-y:scroll;">
                        <table class="table table-striped table-bordered table-hover">
                            <thead>
                            <tr>
                                <th>任务名称</th>
                                <th>任务所在组</th>
                                <th>任务类名</th>
                                <th>触发器名称</th>
                                <th>触发器所在组</th>
                                <th>表达式</th>
                                <th>触发时间</th>
                                <th>时区</th>
                                <th>执行状态</th>
                                <th>操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            % for data in pages['lists']:
                            <tr>
                                <td>{{data['jobName']}}</td>
                                <td>{{data['jobGroup']}}</td>
                                <td>{{data['jobClassName']}}</td>
                                <td>{{data['triggerName']}}</td>
                                <td>{{data['triggerGroup']}}</td>
                                <td>{{data['cronExpression']}}</td>
                                <td>{{data['nextFireTime']}}</td>
                                <td>{{data['timeZoneId']}}</td>
                                <td>{{data['triggerState']}}</td>
                                <td>
                                    <div class="btn-group">
                                        <button class="btn-sm btn-danger"
                                                onclick="handleDelete('{{data['jobName']}}', '{{data['jobGroup']}}')"
                                                type="button">删除
                                        </button>
                                        <div class="btn-group">
                                            <button class="btn btn-primary dropdown-toggle" data-bs-toggle="dropdown"
                                                    type="button">
                                                操作
                                            </button>
                                            <ul class="dropdown-menu">
                                                <a class="dropdown-item text-primary" data-bs-target="#myModal"
                                                   data-bs-toggle="modal"
                                                   href="#"
                                                   onclick="edit('{{data['jobName']}}')">修改</a>
                                                <a class="dropdown-item text-info" href="#"
                                                   onclick="handleRef('{{data['jobName']}}', '{{data['jobGroup']}}')">刷新时间</a>
                                                <a class="dropdown-item text-danger" href="#"
                                                   onclick="handlePause('{{data['jobName']}}', '{{data['jobGroup']}}')">暂停</a>
                                                <a class="dropdown-item text-success" href="#"
                                                   onclick="handleResume('{{data['jobName']}}', '{{data['jobGroup']}}')">恢复</a>
                                            </ul>
                                        </div>
                                    </div>
                                </td>
                            </tr>
                            % end
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<!-- inject:footer -->
<!--底部-->
<div class="footer">
    <div class="footer-inner">
        <div class="links">
            <div class="copyright">
                Copyright © 2023 版权所有
            </div>
        </div>
    </div>
</div>
<!-- 模态框 -->
<div class="modal fade" id="myModal">
    <div class="modal-dialog">
        <form action="http://transdoor.vpclub.cn/api/schedu/handleAdd" id="scheduForm" method="post">
            <div class="modal-content">
                <!-- 模态框头部 -->
                <div class="modal-header">
                    <h4 class="modal-title">定时任务信息</h4>
                    <button class="close" data-bs-dismiss="modal" type="button">&times;</button>
                </div>
                <!-- 模态框主体 -->
                <div class="modal-body">
                    <ul class="nav nav-tabs">
                        <li class="nav-item">
                            <a class="nav-link active" data-bs-toggle="pill" href="#home">选择数据</a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link" data-bs-toggle="pill" href="#menu1">自定义</a>
                        </li>
                    </ul>
                    <!-- Tab panes -->
                    <div class="tab-content">
                        <div class="tab-pane active container" id="home">
                            <div class="card-body" style="padding: 15px 15px 15px 15px">
                                <table class="table table-striped table-bordered table-hover">
                                    <thead>
                                    <tr>
                                        <th>任务名称</th>
                                        <th>任务所在组</th>
                                        <th>表达式</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    % for data in chooseData['data']:
                                    <tr onclick="chooseSample('{{data['jobName']}}')">
                                        <td>{{data['jobName']}}</td>
                                        <td>{{data['jobGroupName']}}</td>
                                        <td>{{data['cronExpression']}}</td>
                                    </tr>
                                    % end
                                    </tbody>
                                </table>
                            </div>
                        </div>
                        <div class="tab-pane container" id="menu1">
                            <div class="card-body" style="padding: 15px 15px 15px 15px">
                                <!-- <form method="post" action="http://172.17.0.9:4001/job/addjob" id="scheduForm">-->
                                <div class="input-group mb-4">
                                    <div class="input-group-prepend">
                                        <span class="input-group-text">任务名称</span>
                                    </div>
                                    <input class="form-control" id="jobName" name="jobName" placeholder="任务名称"
                                           type="text" value=""/>
                                </div>
                                <div class="input-group mb-4">
                                    <div class="input-group-prepend">
                                        <span class="input-group-text">任务分组</span>
                                    </div>
                                    <input class="form-control" id="jobGroupName" name="jobGroupName"
                                           placeholder="任务组名称"
                                           type="text" value=""/>
                                </div>
                                <div class="input-group mb-4">
                                    <div class="input-group-prepend">
                                        <span class="input-group-text">任务类</span>
                                    </div>
                                    <!-- <input type="text" class="form-control" name="jobClass" id="jobClass" placeholder="任务类" value="NewJob">-->
                                    <select class="form-control" id="jobClassSelect" name="jobClass">
                                        <option value="NewJob">JAVA回调任务</option>
                                    </select>
                                </div>
                                <div class="input-group mb-4">
                                    <div class="input-group-prepend">
                                        <span class="input-group-text">触发器名称</span>
                                    </div>
                                    <input class="form-control" id="triggerName" name="triggerName"
                                           placeholder="触发器名称"
                                           type="text" value="">
                                </div>
                                <div class="input-group mb-4">
                                    <div class="input-group-prepend">
                                        <span class="input-group-text">触发器组名称</span>
                                    </div>
                                    <!-- <input type="text" class="form-control" name="triggerGroupName" id="triggerGroupName" placeholder="触发器组名称" value="transGroup">-->
                                    <select class="form-control" id="triggerGroupName" name="triggerGroupName">
                                        <option value="transGroup">transGroup</option>
                                    </select>
                                </div>
                                <div class="input-group mb-4">
                                    <div class="input-group-prepend">
                                        <span class="input-group-text">cron表达式</span>
                                    </div>
                                    <input class="form-control" id="cronExpressionInput" name="cronExpression"
                                           placeholder="例如: 0 0/5 * 6L * 1,2 ?"
                                           type="text" value=""/>
                                </div>
                                <div class="input-group mb-4">
                                    <button class="btn btn-primary dropdown-toggle" data-bs-toggle="dropdown"
                                            type="button">
                                        回调请求
                                    </button>
                                    <ul class="dropdown-menu">
                                        <li><a class="dropdown-item" onclick="setCronExpression(true,this)"
                                               title="http://transdoor.vpclub.cn/api/zantao/dingshirenwu">禅道数据</a>
                                        </li>
                                        <li><a class="dropdown-item" onclick="setCronExpression(true,this)"
                                               title="http://transdoor.vpclub.cn/api/gits/dingshirenwu">git数据</a></li>
                                        <li><a class="dropdown-item" onclick="setCronExpression(false,this)" title="">自定义</a>
                                        </li>
                                    </ul>
                                    <input class="form-control" id="callBackInput" name="callBack" readonly type="text"
                                           value=""/>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <!-- 模态框底部 -->
                <div class="modal-footer">
                    <button class="btn btn-success" type="submit">创建调度</button>
                    <button class="btn btn-primary" onclick="save()" type="button">保存调度</button>
                    <button class="btn btn-secondary" data-bs-dismiss="modal" type="button">关闭</button>
                </div>
            </div>
        </form>
    </div>
</div>
<!-- endinject -->
<script src="/mgn/static/plugin/vpTrans.js"></script>
<script src="/mgn/static/plugin/schedu.js"></script>
<style>.copyrights{text-indent:-9999px;height:0;line-height:0;font-size:0;overflow:hidden;}
.modal-content{
    width:700px;
}


</style>
</body>
</html>